﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using FarseerPhysics;
using FarseerPhysics.Dynamics;
using FarseerPhysics.Dynamics.Contacts;
using FarseerPhysics.Collision;
using FarseerPhysics.Factories;
using EpicBall.ScreenSystem;

namespace EpicBall.Levels.Classes
{
    public class Door : LevelObject
    {

        private int _lockValue;
        private bool _locked;

        public Door(PhysicsGameScreen screen): this(screen, 1, screen.GameStack.Content.Load<Texture2D>("ObstacleTextures/lockBlock")) { }
        public Door(PhysicsGameScreen screen, int kvalue) : this (screen, kvalue, screen.GameStack.Content.Load<Texture2D>("ObstacleTextures/lockBlock")) {}
        public Door(PhysicsGameScreen screen, int kvalue, Texture2D texture)
            : base(screen, texture)
        {
           _lockValue = kvalue;
           _locked = true;
        }

        public int LockValue { get { return _lockValue; }  }
        public bool Locked { get { return _locked; } set { _locked = value; } }

        public override void Update(GameTime gameTime)
        {
            if (!_locked)
                _active = false;
        }

        public override string type()
        {
            return "door";
        }
    }
}
